package hero_info

import (
	"go_server/game_server/protocol/pb"
	"go_server/game_server/util"
	"go_server/game_server/world_manager"
	"go_server/zinx/ziface"
	"go_server/zinx/zlog"
	"go_server/zinx/znet"
)

type Router_UpLvHero struct {
	znet.BaseRouter
}

func (*Router_UpLvHero) Handle(request ziface.IRequest) {
	conn := request.GetConnection()
	msg := &pb.UpLvHeroC2S{}
	if !util.PBParseRet(request, msg) {
		return
	}
	roleId, _ := conn.GetProperty("roleId")
	zlog.Debug("Router_UpLvHero")
	errCode := Hero_info_serviceObj.S2C_UpLvHero(conn, roleId.(int64), msg)
	if errCode != pb.ErrorCodeManager_SUCCESS {
		world_manager.WorldMgrObj.SendClientErrMsg(roleId.(int64), request, errCode, nil)
	}
}
